cmake_minimum_required(VERSION 3.0.0)
project(appmanager)
set(CMAKE_BUILD_TYPE "release")

file(TO_CMAKE_PATH "$ENV{AUTO_CONFIG}" AUTO_CONFIG)
file(TO_CMAKE_PATH "$ENV{APP_BIN_APPMANAGER}" APP_BIN_APPMANAGER)

message(STATUS "Install Prefix (CMAKE_INSTALL_PREFIX):     ${CMAKE_INSTALL_PREFIX}")
message(STATUS "Binary Directory (BIN_INSTALL_DIR):        ${BIN_INSTALL_DIR}")
message(STATUS "Library Directory (LIB_INSTALL_DIR):       ${LIB_INSTALL_DIR}")
message(STATUS "Include Directory (INCLUDE_INSTALL_DIR):   ${INCLUDE_INSTALL_DIR}")
message(STATUS "Documentation Directory (DOC_INSTALL_DIR): ${DOC_INSTALL_DIR}")
message(STATUS "Man Pages Directory (MAN_INSTALL_DIR):     ${MAN_INSTALL_DIR}")
message(STATUS "Build Type (CMAKE_BUILD_TYPE):             ${CMAKE_BUILD_TYPE}")
message(STATUS "Build static libraries:                    ${BUILD_STATIC_LIBS}")
message(STATUS "Build shared library:                      ${BUILD_SHARED_LIBS}")
message(STATUS "Project source dir:                       ${PROJECT_SOURCE_DIR}")


if(HCRTOS)
add_definitions(-DHC_RTOS)
else()
add_definitions(-DHC_LINUX)
endif()

add_compile_options(
  "-include${AUTO_CONFIG}"
)

add_executable(${APP_BIN_APPMANAGER} appmanager.c appdaemon.c)

target_link_libraries(${APP_BIN_APPMANAGER} pthread)

install(TARGETS ${APP_BIN_APPMANAGER} RUNTIME DESTINATION bin)

